package cn.xinfei.xdecision.nacos;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@Data
@ConfigurationProperties(prefix = "xdecision.switch")
public class NacosSwitchProperties {


    private boolean preloadNode;

    private boolean preloadAsync;

    private boolean preloadSync;

    private boolean debugLog;

    private static NacosSwitchProperties nacosSwitchProperties;

    public NacosSwitchProperties() {
        NacosSwitchProperties.nacosSwitchProperties=this;
    }

    public static NacosSwitchProperties getNacosSwitchProperties(){
        if(nacosSwitchProperties==null){
            //不太可能发生
            return new NacosSwitchProperties();
        }
        return nacosSwitchProperties;
    }

}
